<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    str="";
    for(let i=1;i<5;i++)
    {
        for(let j=1;j<5-i;j++)
        {
            str+=" "
        }
        for(let k=1;k<=2*i-1;k++)
        {
            str+="*"
        }
        str+="\n" 
    }
    for(i=1;i<4;i++)
    {
        for(j=1;j<=i;j++)
        {
            str+=" "
        }
        for(k=1;k<=7-2*i;k++)
        {
            str+="*"
        }
        str+="\n"
    }
    console.log(str)

</script>
</html>